package com.ruoyi.peizhen.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.peizhen.mapper.BusinessServerMapper;
import com.ruoyi.peizhen.domain.BusinessServer;
import com.ruoyi.peizhen.service.IBusinessServerService;
import com.ruoyi.common.core.text.Convert;

/**
 * 业务Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-13
 */
@Service
public class BusinessServerServiceImpl implements IBusinessServerService 
{
    @Autowired
    private BusinessServerMapper businessServerMapper;

    /**
     * 查询业务
     * 
     * @param id 业务主键
     * @return 业务
     */
    @Override
    public BusinessServer selectBusinessServerById(Long id)
    {
        return businessServerMapper.selectBusinessServerById(id);
    }

    /**
     * 查询业务列表
     * 
     * @param businessServer 业务
     * @return 业务
     */
    @Override
    public List<BusinessServer> selectBusinessServerList(BusinessServer businessServer)
    {
        return businessServerMapper.selectBusinessServerList(businessServer);
    }

    /**
     * 新增业务
     * 
     * @param businessServer 业务
     * @return 结果
     */
    @Override
    public int insertBusinessServer(BusinessServer businessServer)
    {
        businessServer.setCreateTime(DateUtils.getNowDate());
        return businessServerMapper.insertBusinessServer(businessServer);
    }

    /**
     * 修改业务
     * 
     * @param businessServer 业务
     * @return 结果
     */
    @Override
    public int updateBusinessServer(BusinessServer businessServer)
    {
        businessServer.setUpdateTime(DateUtils.getNowDate());
        return businessServerMapper.updateBusinessServer(businessServer);
    }

    /**
     * 批量删除业务
     * 
     * @param ids 需要删除的业务主键
     * @return 结果
     */
    @Override
    public int deleteBusinessServerByIds(String ids)
    {
        return businessServerMapper.deleteBusinessServerByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除业务信息
     * 
     * @param id 业务主键
     * @return 结果
     */
    @Override
    public int deleteBusinessServerById(Long id)
    {
        return businessServerMapper.deleteBusinessServerById(id);
    }
}
